import { param } from './../../../utils/index';
import { dataQuery, dataVO, dataForm } from './type';
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
// 查询版本管理列表
export const getVersionList = (query: dataQuery): AxiosPromise<dataVO[]> => {
  return request({
    url: '/business/version/list',
    method: 'get',
    params: query
  });
};
// 删除版本
export const deleteVersion = (ids: string | number) => {
  return request({
    url: '/business/version/delete/' + ids,
    method: 'delete'
  });
};
// 作废【载荷版本管理】
export const removeVersion = (ids: string | number) => {
  return request({
    url: '/business/version/remove/' + ids,
    method: 'delete'
  });
};
// 获取最新版本
export const getLatestVersion = (data) => {
  return request({
    url: '/business/version/getLatestVersion',
    method: 'post',
    data
  });
};
//新增【载荷版本管理】
export const addVersion = (data) => {
  return request({
    url: '/business/version',
    method: 'post',
    data
  });
};
//修改【载荷版本管理】
export const editVersion = (data) => {
  return request({
    url: '/business/version',
    method: 'put',
    data
  });
};
//获取【载荷版本管理】详情
export const getVersionDetail = (id: string | number) => {
  return request({
    url: `/business/version/${id}`,
    method: 'get'
  });
};
//查询【公共参数】列表
export const publicParameterList = (params): AxiosPromise => {
  return request({
    url: '/business/publicParameter/list',
    method: 'get',
    params
  });
};
//新增【公共参数】
export const addPublicParameter = (data) => {
  return request({
    url: '/business/publicParameter',
    method: 'post',
    data
  });
};
//修改【公共参数】
export const editPublicParameter = (data) => {
  return request({
    url: '/business/publicParameter',
    method: 'put',
    data
  });
};
//获取【公共参数】详情
export const getPublicParameterDetail = (id: string | number) => {
  return request({
    url: `/business/publicParameter/${id}`,
    method: 'get'
  });
};
// 删除【公共参数】
export const deletePublicParameter = (ids: string | number) => {
  return request({
    url: `/business/publicParameter/${ids}`,
    method: 'delete'
  });
};
//上传【公共参数】文件
export const uploadPublicParameter = (data) => {
  return request({
    url: `/business/publicParameter/upload`,
    method: 'post',
    data
  });
};
//版本升版公共参数复制
export const upgradePublicParameter = (data) => {
  return request({
    url: `/business/publicParameter/upgrade`,
    method: 'post',
    data
  });
};
//查询【特有参数】列表
export const specificParameterList = (params): AxiosPromise => {
  return request({
    url: '/business/specificParameter/list',
    method: 'get',
    params
  });
};
//新增【特有参数】
export const addSpecificParameter = (data) => {
  return request({
    url: '/business/specificParameter',
    method: 'post',
    data
  });
};
//修改【特有参数】
export const editSpecificParameter = (data) => {
  return request({
    url: '/business/specificParameter',
    method: 'put',
    data
  });
};
//获取【特有参数】详情
export const getSpecificParameterDetail = (id: string | number) => {
  return request({
    url: `/business/specificParameter/${id}`,
    method: 'get'
  });
};
// 删除【特有参数】
export const deleteSpecificParameter = (ids: string | number) => {
  return request({
    url: `/business/specificParameter/${ids}`,
    method: 'delete'
  });
};
//上传【特有参数】文件
export const uploadSpecificParameter = (data) => {
  return request({
    url: `/business/specificParameter/upload`,
    method: 'post',
    data
  });
};
//版本升版特有参数复制
export const upgradeSpecificParameter = (data) => {
  return request({
    url: `/business/specificParameter/upgrade`,
    method: 'post',
    data
  });
};
